/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.passive;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import info.peigen.hotpot.component.gateway.dianlan.facade.enums.DianlanChargingPortStatus;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.ENUM;

/**
 * <b>(DianlanHeartBeat)</b>
 * <p>
 * 充电桩心跳包
 * 传送间隔 10 秒周期上送
 * 帧类型码 0x03
 * 序列号域 0001
 * 数据长度 13
 * 帧校验域 6890
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/19
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanHeartBeat {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String                    stubNo;
    /** 充电枪号 */
    @DianlanProtocol(length = 1, start = 7, end = 8, dataType = BCD)
    String                    chargingPortNo;
    /** 充电枪状态 */
    @DianlanProtocol(length = 1, start = 8, end = 9, dataType = ENUM)
    DianlanChargingPortStatus chargingStatus;
}